package biz.core.domain;


import java.util.Map;

import org.apache.commons.lang.StringUtils;

public class UserInfo {
	public final static String USER_SESSION_KEY = "addressbook_login_session";
	private String _userId = "0";
	private String _loginName = "NotLogin";
	private String _realName = "NotLogin";
	private String _roles = "";
	private Map<String, Integer> permissions;
	private String sessionID;

	private Object _data1 = null;
	private Object _data2 = null;

	public String getLoginName() {
		return _loginName;
	}

	public String getRealName() {
		return _realName;
	}

	public String getRoles() {
		return _roles;
	}

	public String getUserId() {
		return _userId;
	}

	public Boolean isLogin() {
		return !StringUtils.isBlank(_userId) && !"0".equals(_userId);
	}

	public void setLoginName(String loginName) {
		this._loginName = loginName;
	}

	public void setRealName(String realName) {
		_realName = realName;
	}

	public void setRoles(String roles) {
		_roles = roles;
	}

	public void setUserId(String userId) {
		_userId = userId;
	}

	public Object getData1() {
		return _data1;
	}

	public Object getData2() {
		return _data2;
	}

	public void setData1(Object o) {
		_data1 = o;
	}

	public void setData2(Object o) {
		_data2 = o;
	}

	public Map<String, Integer> getPermissions() {
		return permissions;
	}

	public void setPermissions(Map<String, Integer> permissions) {
		this.permissions = permissions;
	}

	public String getSessionID() {
		return sessionID;
	}

	public void setSessionID(String sessionId) {
		sessionID = sessionId;
	}

}
